package com;

import com.pojo.Users;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

/**
 * @author 金妞妞
 @@ -23,5 +27,16 @@ public interface UsersMapper {
 int updateByPrimaryKey(Users record);}

 Users findUserWithOrders(Integer id);
 @Select("select * from tb_user where id=#{id}"){
 @Results({
 @Result(column = "username",property = "username"),
 @Result(column = "address",property = "address"),
 @Result(column = "id",property = "ordersList",
 many = @Many(select = "com.mapper.OrderMapper.selectOrdersByUserId")
 )

 })
 Users selectUserById(int id);{


 }
